package me.wsj.demo;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class Main2Activity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Intent intent = new Intent(this, MyService.class);
        startService(intent);

        findViewById(R.id.tvStop).setOnClickListener(v -> {
            stopService(intent);
        });

        Log.e("wsjLib","onCreate");
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.e("wsjLib","onStart");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.e("wsjLib","onResume");
    }
}
